package com.woniu.jifen.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 商品表
 * @TableName t_product_sku
 */
@TableName(value ="t_product_sku")
@Data
public class TProductSku implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 产品具体属于描述：小米 10s 黑色版 8G+256G
     */
    private String skuDescribe;

    /**
     * 商品详情id
     */
    private Long spuId;

    /**
     * 价格
     */
    private BigDecimal skuPrice;

    /**
     * 库存
     */
    private Long skuStore;

    /**
     * 0：删除，1：正常  2:积分商品
     */
    private Integer state;

    /**
     * 商品积分
     */
    private Integer skuIntegral;

    /**
     * 颜色
     */
    private String color;

    /**
     * 好评率
     */
    private String comment;

    /**
     * 图片
     */
    private String img;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TProductSku other = (TProductSku) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSkuDescribe() == null ? other.getSkuDescribe() == null : this.getSkuDescribe().equals(other.getSkuDescribe()))
            && (this.getSpuId() == null ? other.getSpuId() == null : this.getSpuId().equals(other.getSpuId()))
            && (this.getSkuPrice() == null ? other.getSkuPrice() == null : this.getSkuPrice().equals(other.getSkuPrice()))
            && (this.getSkuStore() == null ? other.getSkuStore() == null : this.getSkuStore().equals(other.getSkuStore()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getSkuIntegral() == null ? other.getSkuIntegral() == null : this.getSkuIntegral().equals(other.getSkuIntegral()))
            && (this.getColor() == null ? other.getColor() == null : this.getColor().equals(other.getColor()))
            && (this.getComment() == null ? other.getComment() == null : this.getComment().equals(other.getComment()))
            && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSkuDescribe() == null) ? 0 : getSkuDescribe().hashCode());
        result = prime * result + ((getSpuId() == null) ? 0 : getSpuId().hashCode());
        result = prime * result + ((getSkuPrice() == null) ? 0 : getSkuPrice().hashCode());
        result = prime * result + ((getSkuStore() == null) ? 0 : getSkuStore().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getSkuIntegral() == null) ? 0 : getSkuIntegral().hashCode());
        result = prime * result + ((getColor() == null) ? 0 : getColor().hashCode());
        result = prime * result + ((getComment() == null) ? 0 : getComment().hashCode());
        result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", skuDescribe=").append(skuDescribe);
        sb.append(", spuId=").append(spuId);
        sb.append(", skuPrice=").append(skuPrice);
        sb.append(", skuStore=").append(skuStore);
        sb.append(", state=").append(state);
        sb.append(", skuIntegral=").append(skuIntegral);
        sb.append(", color=").append(color);
        sb.append(", comment=").append(comment);
        sb.append(", img=").append(img);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}